<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 300px;
            height: 300px;
            /* background-color: black; */

            /* 最后一个参数是alpha透明度  取值范围在0-1之间 
            可以把0省略  写.5*/
            background: rgba(0, 0, 0,.5 );
        }
    </style>
</head>
<body>
    <div>

    </div>
</body>
</html>